/**
 * Usage:   <script src="https://epp-jslib.googlecode.com/hg-history/tip/src/epp-array.js"></script>
 **/

/**
 * Examples:
 * 
 * [1,2,3,4,5,6].minus( [3,4,5] );  
 * // => [1, 2, 6]
 * 
 * ["test1", "test2","test3","test4","test5","test6"].minus(["test1","test2","test3","test4"]);  
 * // => ["test5", "test6"]
 **/
Array.prototype.minus = function(array) {
    return this.filter(function(i) {return array.indexOf(i) < 0;});
};
Array.prototype.plus = function(array) {
    return this.concat(array);
};
Array.prototype.last = function() {
    return this[this.length-1];
};
Array.prototype.contains = function(searchElement) {
    return this.indexOf(searchElement)>=0;
};
Array.prototype.spread = function(prop) {
    return this.map(function(it) {return it[prop] })
};
Array.prototype.clone = function() {
	return this.slice(0);
};